#include "dominion.h"
#include "dominion_helpers.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int testGetCost(int cardNumber)
{
  switch( cardNumber ) 
    {
    case curse:
      return 0;
    case estate:
      return 2;
    case duchy:
      return 5;
    case province:
      return 8;
    case copper:
      return 0;
    case silver:
      return 3;
    case gold:
      return 6;
    case adventurer:
      return 6;
    case council_room:
      return 5;
    case feast:
      return 4;
    case gardens:
      return 4;
    case mine:
      return 5;
    case remodel:
      return 4;
    case smithy:
      return 4;
    case village:
      return 3;
    case baron:
      return 4;
    case great_hall:
      return 3;
    case minion:
      return 5;
    case steward:
      return 3;
    case tribute:
      return 5;
    case ambassador:
      return 3;
    case cutpurse:
      return 4;
    case embargo: 
      return 2;
    case outpost:
      return 5;
    case salvager:
      return 4;
    case sea_hag:
      return 4;
    case treasure_map:
      return 4;
    }
	
  return -1;
}

void test()
{	
	int d[27] = {curse,estate,duchy,province,copper,silver,gold,adventurer,council_room,feast,gardens,
					mine,remodel,smithy,village,baron,great_hall,minion,steward,tribute,ambassador,
					cutpurse,embargo,outpost,salvager,sea_hag,treasure_map};
	
	for (int i = 0; i < 27; i++)
	{
		if (testGetCost(d[i]) == -1)
		{
			printf("getCost(): FAIL when getting card cost\n");
			break;
		}
		
		if (i == 26)
			printf("getCost(): PASS all get card cost tests\n");
	}
	
	if (testGetCost(curse) == 0)
		printf("getCost(): PASS when testing curse cost\n");
	else
		printf("getCost(): FAIL when testing curse cost\n");
	
	if (testGetCost(treasure_map) == 4)
		printf("getCost(): PASS when testing treasure_map cost\n");
	else
		printf("getCost(): FAIL when testing treasure_map cost\n");
	
	if (testGetCost(province) == 8)
		printf("getCost(): PASS when testing province cost\n");
	else
		printf("getCost(): FAIL when testing province cost\n");
}

int main(int argc, char *argv[])
{
	test();
	return 0;
}
